#pragma once

#include <common/HeaderSpace.h>

#include <map>
#include <memory>
#include <string>
#include <vector>

namespace flashpp {

class Device;

class Port {
 public:
  Port(std::string name, Device& device) : name_(name), device_(device) {
    peer_ = nullptr;
  };

  void
  setPeer(Port* peer) {
    peer_ = peer;
  }

  Port*
  getPeer() {
    return peer_;
  }

  Device&
  getDevice() {
    return device_;
  }

  void
  setHS(HeaderSpace hs) {
    hs_ = hs;
  }

  HeaderSpace
  getHS() {
    return hs_;
  }

 private:
  std::string name_;
  Device& device_;
  Port* peer_;

  // The effective header space forward to this port
  HeaderSpace hs_;
};

} // namespace flashpp